Carbon


KCGetAttribute

Header: Keychain.h Carbon status: Under Evaluation

Retrieves attribute data from a keychain item.

OSStatus KCGetAttribute (
    KCItemRef item, 
    KCAttribute *attr, 
    UInt32 *actualLength
);
item

A reference to the keychain item whose attribute data you wish to modify.

attr

A pointer to a structure containing the keychain item attribute data you wish to obtain. Before calling KCGetAttribute, you should set the tag field to a tag identifying the attribute to get, the length field to the maximum length of the data buffer pointed to by data, and the data field to a pointer to a buffer of sufficient length for the type of data to be returned. On return, the data field contains the requested attribute data.

actualLength

The actual length of the attribute data.

function result

A result code. The result code errKCInvalidItemRef indicates that the specified keychain item reference was invalid. The result code errKCNoSuchAttr indicates that you tried to set an attribute which is undefined for this item class. The result code errKCBufferTooSmall indicates that your application must allocate a new buffer of sufficient size before calling KCGetAttribute again.

DISCUSSION

You can call the KCGetAttribute function to retrieve attribute data from a keychain item. Standard item attributes which can be retrieved include attributes defined by the constants kClassKCItemAttr, kCreationDateKCItemAttr, kModDateKCItemAttr, kDescriptionKCItemAttr, kCommentKCItemAttr, kLabelKCItemAttr, kCreatorKCItemAttr, kScriptCodeKCItemAttr, and kCustomIconKCItemAttr. See “Keychain Item Attribute Tag Constants” for a description of the attributes these constants define. Each class of item has additional attributes specific to that class which may be modified. For a complete list, see “Keychain Item Attribute Tag Constants”.

VERSION NOTES

Available beginning with Keychain Manager 1.0.

AVAILABILITY

Under evaluation for Carbon. Available in CarbonLib 1.0 and later when KeychainLib 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by KeychainLib 1.0 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)